package com.scpcfe.www.service;


import com.scpcfe.www.dao.StudentInfoDao;
import com.scpcfe.www.entity.StudentInfoEntity;
import com.scpcfe.www.entity.UserLoginEntity;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@Component
public class UserLoginService {
    @Autowired//自动装配，自动给他创建一个对象并实列化
    StudentInfoDao userLoginDao;
    public static UserLoginService userLoginService;//单列模式（内存中保留一份对象)

    @PostConstruct
    public void init() {
        userLoginService = this;
        userLoginService.userLoginDao = this.userLoginDao;
    }
    public List<UserLoginEntity> login(String user,String password){
        return userLoginDao.login(user,password);
    }

    }